package socketmvc.client.packets;

import socketmvc.core.packets.basic.impl.JsonSimplePacket;
import socketmvc.core.packets.basic.impl.JsonTextBody;

import java.util.HashMap;
import java.util.Map;

public class SocketConnectedPacket extends JsonSimplePacket {

    public SocketConnectedPacket(){
        this.textBody = new JsonTextBody();
        this.setCommand("/@socket-connected");
    }

    public SocketConnectedPacket(Integer code, String reason){
        Map<String, Object> body = new HashMap<>();
        body.put("code",code);
        body.put("reason",reason);
        this.textBody = new JsonTextBody();
        this.textBody.setBody(body);
        this.setCommand("/@socket-connected");
    }
}
